# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=zenith
pkgver=0.14.0
pkgrel=1
pkgdesc="Sort of like htop but with zoom-able charts, CPU, GPU, network, disk usage"
url="https://github.com/bvaisvil/zenith"
# riscv64: couldn't verify - broken CI
# s390x: fails to build nix crate
arch="all !riscv64 !s390x"
license="MIT"
_llvmver=16
makedepends="
	cargo
	cargo-auditable
	clang$_llvmver-dev
	linux-headers
	llvm$_llvmver-dev
	"
source="https://github.com/bvaisvil/zenith/archive/$pkgver/zenith-$pkgver.tar.gz
	update-linux-taskstats.patch
	"
# !check: no tests provided
# net: fetch dependencies
options="!check net"


prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
	install -D -m644 assets/$pkgname.desktop -t "$pkgdir"/usr/share/applications/
	install -D -m644 assets/$pkgname.png -t "$pkgdir"/usr/share/icons/96x96/apps/
}

sha512sums="
dac74b0fa9e3563655dc1e9cbdda7e809791d2c9d865ba990dfbd020d6f01a52585595feb28f60fa4f3ada147dc21d2a953062c8b5eeecfa77be5bfc378a055a  zenith-0.14.0.tar.gz
c71f8bd8fceec4a441b46d212b17ec08af1b595d9a034e145db821832a382094700913f29dc15721e13385afd1482b55f55cfb1be1be07638291966cd8bea954  update-linux-taskstats.patch
"
